# 942 简单：增减字符串匹配

def diStringMatch(s):
    minm, maxm = 0, len(s)
    ret = []
    for c in s:
        if c == 'I':
            ret.append(minm)
            minm += 1
        else:
            ret.append(maxm)
            maxm -= 1
    ret.append(minm)
    return ret


print(diStringMatch('IIIII'))
